@extends('layout.admin')

@section('content')
<style type="text/css"> 
    #pages li{
        background-color: #444444;
        border-left: 1px solid rgba(255, 255, 255, 0.15);
        border-right: 1px solid rgba(0, 0, 0, 0.5);
        box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.15) inset;
        color: #fff;
        cursor: pointer;
        display: block;
        float: left;
        font-size: 12px;
        height: 20px;
        line-height: 20px;
        outline: medium none;
        padding: 0 10px;
        text-align: center;
        text-decoration: none;
    }
    #pages .disabled{
        color: #666666;
        cursor: default;
    }

    #pages .active{
        background:#808080;
        color:#323232;
    }

    #pages{
        height:auto;
        overflow:hidden;
        padding:0px;
        margin:0px;
    }

    #pages ul{
        padding:0px;
        margin:0px;
    }
</style>
<div class="mws-panel grid_8 mws-collapsible">
  <div class="mws-panel-header">
    <span>
      <i class="icon-table"></i>商品列表</span>
    <div class="mws-collapse-button mws-inset">
      <span></span>
    </div>
  </div>
  <div class="mws-panel-inner-wrap">
    <div class="mws-panel-body no-padding">
      <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper" role="grid">
      <form action="/goods/index" method='get'>
          
        <div id="DataTables_Table_0_length" class="dataTables_length">
          <label>显示
            <select size="1" name="num" aria-controls="DataTables_Table_0">
              <option value="10" selected="selected">10</option>
              <option value="25">25</option>
              <option value="50">50</option>
              <option value="100">100</option></select>条</label>
        </div>
        <div class="dataTables_filter" id="DataTables_Table_0_filter">
          <label>搜索:
            <input aria-controls="DataTables_Table_1" name="keyword" value="{{$request->input('keyword')}}" type="text">&nbsp;<button class="btn btn-info"><i class="icon-search"></i></button></label></div>
      </form>
        <table class="mws-table mws-datatable dataTable" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
          <thead>
            <tr role="row">
              <th class="sorting_asc" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending" style="width: 115px;">商品ID</th>
              <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending" style="width: 155px;">商品名</th>
              <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending" style="width: 144px;">价格</th>
              <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending" style="width: 144px;">类别</th>
              <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending" style="width: 144px;">库存</th>
              <!-- <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending" style="width: 70px;">操作</th> -->
              <th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" aria-label="" style="width: 102px;">操作</th>
            </tr>
          </thead>
          <tbody role="alert" aria-live="polite" aria-relevant="all">
          @foreach($goods as $k=>$v)
            <tr class="odd">
              <td class=" sorting_1">{{$v->gid}}</td>
              <td class=" ">{{$v->gname}}</td>
              <td class=" ">{{$v->price}}</td>
              <td class=" ">{{$v->names}}</td>
              <td class=" ">{{$v->cnt}}</td>
              <td class=" ">
                <span class="btn-group">
                  <a href="/goods/edit?gid={{$v->gid}}" class="btn btn-small">
                    <i class="icon-pencil"></i>
                  </a>
                  <a href="/goods/delete?gid={{$v->gid}}" class="btn btn-small">
                    <i class="icon-trash"></i>
                  </a>
                </span>
              </td>
            </tr>
          @endforeach
          </tbody>
        </table>
      <div class="dataTables_paginate paging_full_numbers" id="DataTables_Table_1_paginate">
        <div id="pages">
        {!! $goods->appends($request->all())->render() !!}
        </div>
    </div>
    </div>
  </div>
</div>
@endsection